<style scoped>

</style>
<template>
  <van-nav-bar class="info-nav-bar" :title="title" v-bind="bindData" @click-left="href_handle(this.leftHref)" @click-right="href_handle(this.rightHref)" />
</template>

<script>

import {href_handle} from "@/vue_plugin/router_auto.js";
import {to_string} from "@/js/s94_tool.js";

/**导航栏
 * @prop {String} html html内容
 */
export default {
  _title_: '导航栏标题',
  _tip_: '一般是放着头部的导航栏标题，可以定义左右侧的文本和链接',
  _head_img_: '',
  _group_: '详情组件',
  props: {
    title: {
      type: String,
      _label_: '标题',
      _tip_: '',
      _default_: "get($info,'title')",
    },
    leftHref: {
      type: [String, Number],
      _label_: '左侧链接，为空不会显示左侧箭头和文字',
      _tip_: '',
      _default_: "-1",
    },
    leftText: {
      type: String,
      _label_: '标题',
      _tip_: '左侧文案',
    },
    rightHref: {
      type: [String, Number],
      _label_: '右侧链接',
      _tip_: '',
      _default_: "",
    },
    rightText: {
      type: String,
      _label_: '标题',
      _tip_: '右侧文案, 为空不显示',
    },

  },
  data(){
    return {}
  },
  methods:{
    href_handle,
  },
  computed:{
    bindData(){
      return {
        leftArrow: !!to_string(this.href),
        leftText: to_string(this.leftText),
        rightText: to_string(this.rightText),
      }
    }
  },
  mounted(){
  }
}
</script>